Skip to content

Add FindKML.cmake and resolve FFTW3 issue#7576

Merged
mohanchen merged 3 commits into
deepmodeling:developfrom
Growl1234:cmake
Jul 3, 2026
Merged

Add FindKML.cmake and resolve FFTW3 issue#7576
mohanchen merged 3 commits into
deepmodeling:developfrom
Growl1234:cmake

Conversation

@Growl1234

@Growl1234 Growl1234 commented Jul 1, 2026

Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings July 1, 2026 08:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR adds first-class CMake support for Huawei Kunpeng Math Library (KML) via a custom FindKML.cmake, and refactors dependency linking to address FFTW3-related configuration issues.

Changes:

  • Introduce cmake/FindKML.cmake providing imported targets for KML BLAS/LAPACK/ScaLAPACK and FFTW3-compatible interfaces.
  • Update CMakeLists.txt to use find_package(KML ...) when USE_KML is enabled and to restructure FFTW3 linking.
  • Adjust FFTW toolchain environment exports in install_fftw.sh (removing CPATH and CP_* flag exports).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
toolchain/scripts/stage3/install_fftw.sh Removes CPATH/CP_* environment exports for FFTW, affecting how downstream builds pick up FFTW headers/flags.
cmake/FindKML.cmake Adds a new find-module that detects KML variants/components and defines imported targets.
CMakeLists.txt Switches KML integration to find_package(KML ...) and refactors dependency linking (MPI/MKL/FFTW3).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread cmake/FindKML.cmake
Comment thread toolchain/scripts/stage3/install_fftw.sh
Comment thread toolchain/scripts/stage3/install_fftw.sh
@Growl1234

Copy link
Copy Markdown
Author

@QuantumMisaka Please have a look if a bare build with FFTW support passes your test.

Comment thread cmake/FindKML.cmake Outdated
Comment thread cmake/FindKML.cmake
@Growl1234

Copy link
Copy Markdown
Author

I am missing something. The issue #7567 should be resolved together in this PR.

@mohanchen mohanchen added the Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS label Jul 1, 2026

@ZhouXY-PKU ZhouXY-PKU left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! Thanks for your contribution!

@ZhouXY-PKU ZhouXY-PKU requested a review from QuantumMisaka July 2, 2026 14:55
@mohanchen mohanchen merged commit 59dc884 into deepmodeling:develop Jul 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code scan] Do not require fftw3f when ENABLE_FLOAT_FFTW is off

4 participants